package com.cdxy.util;

import com.cdxy.enums.UserTypeEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: tangy
 * @Date: 2020/3/6 17:30
 */
public class NicknameUtil {

    /**
     * 生成默认昵称
     * @param userTypeEnum
     * @param uid
     * @return
     */
    public static String buildDefaultNickName(UserTypeEnum userTypeEnum, String uid) {
        if (UserTypeEnum.MOBILE.name().equals(userTypeEnum.name())){
            return StringUtils.join("手机用户-", uid);
        }
        else if (UserTypeEnum.EMAIL.equals(userTypeEnum)){
            return StringUtils.join("邮箱用户-", uid);
        }
        return "游客-" + uid;
    }
}
